<template>
   
        <RadioButtonGroup v-model="selectedOption" :options="options"
        @optionSelected="handleOptionSelected"
        />
    
</template>

<script setup>
import { ref } from 'vue';

import bianliang from '../assets/bianliang.json';
import hanshu from '../assets/hanshu.json';
import liebiao from '../assets/liebiao.json';
import loop from '../assets/loop.json';
import yunsuan from '../assets/yunsuan.json';
import { useStore } from '../store/store';
import RadioButtonGroup from './RadioButtonGroup.vue';
const store = useStore();
const options = [
    { value: 'option1', label: '循环',toolbox:loop },
    { value: 'option2', label: '运算',toolbox:yunsuan },
    { value: 'option3', label: '变量',toolbox:bianliang },
    { value: 'option4', label: '列表',toolbox:liebiao },
    { value: 'option5', label: '函数',toolbox:hanshu },
];

const selectedOption = ref('');
const handleOptionSelected = (index) => {
    console.log('选中的选项:', index);
    store.workspaceSvg.updateToolbox(options[index].toolbox);
    // 在这里添加您想要的逻辑
};
</script>

<style scoped>

</style>